﻿using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using 纸片人.CalculateControls;
using 纸片人.win2dEffectControl.DataClass;


// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235

namespace 纸片人.win2dEffectControl
{
    public class ArithmeticCompositeEffectControl : TwoSourceEffectControl
    {

        private CheckBox clampOutputCheckBox;
        private TextBoxSlider multiplyAmountSlider;
        private TextBoxSlider offsetSlider;
        private Vector2Control amountVector2Control;




        public ArithmeticCompositeEffectControl()
        {
            this.DefaultStyleKey = typeof(ArithmeticCompositeEffectControl);
            TwoEffectData = new ArithmeticCompositeEffectData();
        }

        public override EffectTwoSourceData TwoEffectData { get; set; }

        protected override void OnApplyTemplate()
        {

            base.OnApplyTemplate();
            SetEffectName("算术复合效果","ArithmeticCompositeEffect");


            clampOutputCheckBox = GetTemplateChildFormName<CheckBox>(nameof(clampOutputCheckBox));
            SetCheckBox(clampOutputCheckBox, TwoEffectData, nameof(ArithmeticCompositeEffectData.ClampOutput));

            offsetSlider = GetTemplateChildFormName<TextBoxSlider>(nameof(offsetSlider));
            SetTextBoxSlider(offsetSlider, TwoEffectData, nameof(ArithmeticCompositeEffectData.Offset));


            multiplyAmountSlider = GetTemplateChildFormName<TextBoxSlider>(nameof(multiplyAmountSlider));
            SetTextBoxSlider(multiplyAmountSlider, TwoEffectData, nameof(ArithmeticCompositeEffectData.MultiplyAmount));

            

            amountVector2Control = GetTemplateChildFormName<Vector2Control>(nameof(amountVector2Control));
            SetVector2Control(amountVector2Control, TwoEffectData, nameof(ArithmeticCompositeEffectData.SourceAmount));

           
        }






    }
}
